import javax.swing.JOptionPane; 

public class Ex3_18 {
  public static void main(String args[]) {
    String s = JOptionPane.showInputDialog("Enter a year");
	int year = Integer.parseInt(s);

    // Check if the year is a leap year 
    boolean isLeapYear = 
      (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);

    // Display the result in a message dialog box
    JOptionPane.showMessageDialog(null, year + " is a leap year? " + isLeapYear);   
  } 
}
